home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 February / PCWFEB06.iso / Software / FromTheMag / PrintFile 2.1.5 / PrFile32.exe / 1033 / RCDATA / 142 < prev    next >
Encoding:
Text File  |  2001-09-08  |  3.7 KB  |  166 lines

  1. %!
  2. %%Creator: PrintFile version 2.1.4
  3. %%LanguageLevel: 2
  4. %%EndComments
  5. %%BeginProlog
  6. %
  7. % PrintFile PostScript n-up printing procedure set
  8. % Copyright 1997-2000 Peter Lerup
  9. % Author: Peter Lerup
  10. % Date:   00-07-27
  11.  
  12. /PrFileDict 50 dict def
  13.  
  14. PrFileDict begin
  15.  
  16. /saveCnt 0 def
  17. /gsaveCnt 0 def
  18. /currMatrix matrix currentmatrix def
  19.  
  20. /logPageNo 0 def
  21.  
  22. /min { 2 copy gt { exch } if pop } def
  23. /xdef { exch def } def
  24.  
  25. /initCS
  26. {
  27.   currMatrix setmatrix 
  28.   initclip newpath 0 0 moveto pageWidth 0 rlineto 0 pageHeight rlineto
  29.   pageWidth neg 0 rlineto closepath clip newpath
  30. } def
  31.  
  32. /__restore
  33. {
  34.   PrFileDict begin
  35.   logPageNo [ currMatrix {} forall 9 -1 roll
  36.   end
  37.   restore
  38.   PrFileDict begin
  39.   ] /currMatrix xdef
  40.   /logPageNo xdef
  41.   initCS
  42.   end
  43. } bind def
  44.  
  45. /__grestore
  46. {
  47.   grestore PrFileDict begin initCS end
  48. } bind def
  49.  
  50. /setup {
  51.   /frameWidth xdef
  52.   /drawFrame xdef
  53.   /advHor xdef
  54.   /landscape xdef
  55.   /nHeight xdef
  56.   /nWidth xdef
  57.   /ygutter xdef
  58.   /xgutter xdef
  59.   /bottomMarg xdef
  60.   /topMarg xdef
  61.   /rightMarg xdef
  62.   /leftMarg xdef
  63.  
  64.   currentpagedevice /PageSize get {} forall
  65.   /pageHeight xdef
  66.   /pageWidth xdef
  67.  
  68.   /drawWidth pageWidth leftMarg sub rightMarg sub def
  69.   /drawHeight pageHeight topMarg sub bottomMarg sub def
  70.  
  71.   landscape
  72.     { drawWidth drawHeight /drawWidth xdef /drawHeight xdef }
  73.   if 
  74.  
  75.   /logPageWidth drawWidth xgutter nWidth 1 sub mul sub nWidth div def
  76.   /logPageHeight drawHeight ygutter nHeight 1 sub mul sub nHeight div def
  77.  
  78.   /scaleFact
  79.     logPageWidth pageWidth div
  80.     logPageHeight pageHeight div
  81.     min def
  82.  
  83.   /xOffset logPageWidth scaleFact pageWidth mul sub 2 div def
  84.   /yOffset logPageHeight scaleFact pageHeight mul sub 2 div def
  85.  
  86.   systemdict /setpagedevice known
  87.     { 
  88.       <</BeginPage PrFileDict /BeginPage get 
  89.         /EndPage PrFileDict /EndPage get>> setpagedevice
  90.     }
  91.   if
  92.  
  93. } def
  94.  
  95. /BeginPage {
  96.   PrFileDict begin
  97.   pop
  98.   landscape { pageWidth 0 translate 90 rotate } if
  99.     landscape {rightMarg} {leftMarg} ifelse
  100.     logPageNo advHor {nWidth mod} {nHeight idiv} ifelse
  101.       logPageWidth xgutter add mul add
  102.     landscape {topMarg} {bottomMarg} ifelse
  103.     nHeight 1 sub logPageNo advHor {nWidth idiv} {nHeight mod} ifelse 
  104.       sub logPageHeight ygutter add mul add
  105.   translate
  106.  
  107.   /logPageNo logPageNo 1 add nWidth nHeight mul mod def
  108.  
  109.   xOffset yOffset translate
  110.   scaleFact dup scale
  111.   /currMatrix matrix currentmatrix def
  112.   /saveCnt 0 def
  113.   /gsaveCnt 0 def
  114.   initCS
  115.   end
  116. } def
  117.  
  118. /alldone false def
  119.  
  120. /EndPage {
  121.   2 eq
  122.   { pop false }
  123.   {
  124.     pop
  125.     PrFileDict begin
  126.     alldone
  127.     { logPageNo 1 ne nWidth nHeight mul 1 ne and }
  128.     {
  129.       drawFrame
  130.       {
  131.          initgraphics initclip
  132.          frameWidth setlinewidth newpath
  133.          1 scaleFact div dup scale
  134.          xOffset neg yOffset neg translate
  135.          0 0 moveto logPageWidth 0 rlineto
  136.          0 logPageHeight rlineto logPageWidth neg 0 rlineto
  137.          0 logPageHeight neg rlineto closepath
  138.          stroke
  139.       }
  140.       if 
  141.  
  142.       logPageNo 0 eq
  143.     }
  144.     ifelse
  145.     end
  146.   }
  147.   ifelse
  148. } def
  149.  
  150. /close {
  151.   /alldone true def showpage
  152. } def
  153.  
  154. end
  155.  
  156. /save { PrFileDict begin /saveCnt saveCnt 1 add def end save } bind def
  157. /restore { PrFileDict /saveCnt get 0 gt { restore } { PrFileDict /__restore get exec } ifelse  } bind def
  158. /gsave { PrFileDict begin /gsaveCnt gsaveCnt 1 add def end gsave } bind def
  159. /grestore { PrFileDict /gsaveCnt get 0 gt { grestore } { PrFileDict /__grestore get exec } ifelse  } bind def
  160. /initgraphics { initgraphics PrFileDict begin initCS end } bind def
  161. /initmatrix { PrFileDict begin currMatrix end setmatrix } bind def
  162.  
  163. %%EndProlog
  164.  
  165.